<%--
  Created by IntelliJ IDEA.
  User: 24258
  Date: 2022/8/28
  Time: 15:16
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <base href="http://${pageContext.request.serverName}:${pageContext.request.serverPort}${pageContext.request.contextPath}/"/>
    <script type="text/javascript" src="jquery/jquery-2.1.1.min.js"></script>
    <script type="text/javascript" src="layer/layer.js"></script>
    <script type="text/javascript">
        $(function (){

            $("#btn1").click(function (){
                $.ajax({
                    url:"send/array/one.html",
                    type:"post",
                    data:{
                        "array":[1,2,3]
                    },
                    dataType:"text",
                    success:function (data){
                        alert(data)
                    },
                    error:function (data){
                        alert(data)
                    }
                })
            })
            $("#btn2").click(function (){
                var array = [1,2,3];
                var requestBody = JSON.stringify(array);
                $.ajax({
                    url:"send/array/two.html",
                    type:"post",
                    data:requestBody,
                    contentType:"application/json;charset=UTF-8",
                    dataType:"text",
                    success:function (data){
                        alert(data)
                    },
                    error:function (data){
                        alert(data)
                    }
                })
            })
            $("#btn3").click(function (){
                layer.msg("Layer弹框");
            })


        })
    </script>
</head>
<body>

    <a href="test/ssm.html">测试SSM整合框架</a>
    <br>
    <button id="btn1">Send [1,2,3] One</button>
    <br>
    <button id="btn2">Send [1,2,3] Two</button>
    <br>
    <button id="btn3">layer弹框</button>
</body>
</html>
